package com.wtoip.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

@Configuration
public class RedisConfig {
	@Bean
	@ConfigurationProperties(prefix="spring.redis.pool")
	public JedisPoolConfig getJedisPoolConfig() {
		JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
		return jedisPoolConfig;
	}
	
	@Bean
	@ConfigurationProperties(prefix="spring.redis")
	public JedisPool getJedisPool(JedisPoolConfig config) {
		JedisPool jedisPool = new JedisPool();
		return jedisPool;
	}
}
